#include <stdio.h>
#include <stdlib.h>
#include <time.h>


int main()
{
    srand((unsigned int)time(NULL));

    FILE *p = fopen("a.txt", "w");
    if (p)
    {
        int i;
        for(i = 0; i < 1000; i++)
        {
            int seq = rand() % 256;
            char buf[100] = { 0 };
            sprintf(buf, "%d\n", seq);
            fputs(buf, p);
        }
        fclose(p);
    }
    return 0;
}




